| 
| advbot2.inc 
| Include file 2 for advbot.mac 
| Version 1.99b-final 
| Date:8/19/2005
| 


Sub LoadINIVals 
/declare a int local 
/declare b int local 
/declare INIFlag int local 
/declare TempStr string local 

/varset INIFlag 0 
/varset TempStr ${Ini[${IniFile},Settings,Radius,NOTFOUND]} 
/varset Radius ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings Radius 100 
   /varset Radius 100 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,NoSit,NOTFOUND]} 
/varset NoSit ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings NoSit 1
   /varset NoSit 1
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,TrackNumber,NOTFOUND]} 
/varset TrackNumber ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings TrackNumber 10 
   /varset TrackNumber 10 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,Announce,NOTFOUND]} 
/varset Announce ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings Announce 0 
   /varset Announce 0 
   /varset INIFlag 1 
} 

/varset AnnounceChannel ${Ini[${IniFile},Settings,AnnounceChannel,NOTFOUND]} 
/if (${AnnounceChannel.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings AnnounceChannel gsay 
   /varset AnnounceChannel gsay 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,Reply,NOTFOUND]} 
/varset Reply ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings Reply 0 
   /varset Reply 0 
   /varset INIFlag 1 
} 

/varset ReplyChannel ${Ini[${IniFile},Settings,ReplyChannel,NOTFOUND]} 
/if (${ReplyChannel.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings ReplyChannel "tell @" 
   /varset ReplyChannel tell @ 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,RetryCount,NOTFOUND]} 
/varset RetryCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings RetryCount 2 
   /varset RetryCount 2 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseDebuffs,NOTFOUND]} 
/varset PauseDebuffs ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseDebuffs 1 
   /varset PauseDebuffs 1 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseEvents,NOTFOUND]} 
/varset PauseEvents ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseEvents 1 
   /varset PauseEvents 1 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseHeals,NOTFOUND]} 
/varset PauseHeals ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseHeals 1 
   /varset PauseHeals 1 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseAssist,NOTFOUND]} 
/varset PauseAssist ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseAssist 0 
   /varset PauseAssist 0 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseSelfBuffs,NOTFOUND]} 
/varset PauseSelfBuffs ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseSelfBuffs 0 
   /varset PauseSelfBuffs 0 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,PauseGroupBuffs,NOTFOUND]} 
/varset PauseGroupBuffs ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings PauseGroupBuffs 0 
   /varset PauseGroupBuffs 0 
   /varset INIFlag 1  
} 

/varset TankName ${Ini[${IniFile},Settings,MainAssistName,NOTFOUND]} 
/if (${TankName.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings MainAssistName "Main Assist Name" 
   /varset TankName Main Assist Name 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,DoAFK,NOTFOUND]}
/varset DoAFK ${TempStr}
/if (${TempStr.Equal["NOTFOUND"]}) {
   /ini "${IniFile}" Settings DoAFK 0
   /varset DoAFK 0
   /varset INIFlag 1
}

/varset AFKMessage ${Ini[${IniFile},Settings,AFKMessage,NOTFOUND]}
/if (${AFKMessage.Equal["NOTFOUND"]}) {
   /ini "${IniFile}" Settings AFKMessage "AFK Message"
   /varset AFKMessage AFK Message
   /varset INIFlag 1
}

/varset Dismount ${Ini[${IniFile},Settings,Dismount,NOTFOUND]} 
/if (${Dismount.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings Dismount "nodismount" 
   /varset Dismount nodismount 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Settings,FollowDistance,NOTFOUND]} 
/varset BotFollowDistance ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings FollowDistance 20 
   /varset BotFollowDistance 20 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Settings,SitAggroRadiusCheck,NOTFOUND]} 
/varset SitAggroRadiusCheck ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Settings SitAggroRadiusCheck 75 
   /varset SitAggroRadiusCheck 75 
   /varset INIFlag 1  
}  

/varset TempStr ${Ini[${IniFile},SelfBuff,SelfBuffCount,NOTFOUND]} 
/varset SelfBuffCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffCount 0 
   /varset SelfBuffCount 0 
   /varset INIFlag 1  
} 

/for a 1 to 8 
/varset SelfBuff[${a}] ${Ini[${IniFile},SelfBuff,SelfBuff${a},NOTFOUND]} 
/if (${SelfBuff[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuff${a} "Self Buff Spell Name" 
   /varset SelfBuff[${a}] "Self Buff Spell Name" 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset SelfBuffAliasName[${a}] ${Ini[${IniFile},SelfBuff,SelfBuffAliasName${a},NOTFOUND]} 
/if (${SelfBuffAliasName[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffAliasName${a} "Self Buff Alias Name" 
   /varset SelfBuffAliasName[${a}] Self Buff Alias Name 
   /varset INIFlag 1 
} 
/next a 

/if (${SelfBuffCount}>0) { 
    /for a 1 to ${SelfBuffCount} 
        /varset SelfBuffID[${a}] ${Spell["${SelfBuff[${a}]}"].ID} 
    /next a 
} 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},SelfBuff,SelfBuffDuration${a},NOTFOUND]} 
/varset SelfBuffDuration[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffDuration${a} 0 
   /varset SelfBuffDuration[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},SelfBuff,SelfBuffAtStart${a},NOTFOUND]} 
/varset SelfBuffAtStart[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffAtStart${a} 0 
   /varset SelfBuffAtStart[${a}] 0 
   /varset INIFlag 1 
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},SelfBuff,SelfBuffIconCheck${a},NOTFOUND]} 
/varset SelfBuffIconCheck[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffIconCheck${a} 0 
   /varset SelfBuffIconCheck[${a}] 0 
   /varset INIFlag 1 
} 
/if (${SelfBuffIconCheck[${a}]}==1) { 
    /varset SelfBuffedList[${a}] 12345 
} 
/next a 

/for a 1 to 8 
/varset SelfBuffIconName[${a}] ${Ini[${IniFile},SelfBuff,SelfBuffIconName${a},NOTFOUND]} 
/if (${SelfBuffIconName[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffIconName${a} "Self Buff Icon Name" 
   /varset SelfBuffIconName[${a}] Self Buff Icon Name 
   /varset INIFlag 1 
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},SelfBuff,SelfBuffMemToSlot${a},NOTFOUND]} 
/varset SelfBuffMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffMemToSlot${a} 0 
   /varset SelfBuffMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset SelfBuffCheckTime ${Ini[${IniFile},SelfBuff,SelfBuffCheckTime,NOTFOUND]} 
/if (${SelfBuffCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" SelfBuff SelfBuffCheckTime 15s 
   /varset SelfBuffCheckTime 15s 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Debuff,DebuffCount,NOTFOUND]} 
/varset DebuffCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffCount 0 
   /varset DebuffCount 0 
   /varset INIFlag 1  
} 

/for a 1 to 8 
/varset Debuff[${a}] ${Ini[${IniFile},Debuff,Debuff${a},NOTFOUND]} 
/if (${Debuff[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff Debuff${a} "Debuff Spell Name" 
   /varset Debuff[${a}] Debuff Spell Name 
   /varset INIFlag 1  
} 
/next a 

/if (${DebuffCount}>0) { 
    /for a 1 to ${DebuffCount} 
        /varset DebuffID[${a}] ${Spell["${Debuff[${a}]}"].ID} 
    /next a 
} 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffDuration${a},NOTFOUND]} 
/varset DebuffDuration[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffDuration${a} 99999 
   /varset DebuffDuration[${a}] 99999 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffStartWait${a},NOTFOUND]} 
/varset DebuffStartWait[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffStartWait${a} 0 
   /varset DebuffStartWait[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffMinHealth${a},NOTFOUND]} 
/varset DebuffMinHealth[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffMinHealth${a} 100 
   /varset DebuffMinHealth[${a}] 100 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffMinHealthNoCast${a},NOTFOUND]} 
/varset DebuffMinHealthNoCast[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffMinHealthNoCast${a} 0 
   /varset DebuffMinHealthNoCast[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffMinMana${a},NOTFOUND]} 
/varset DebuffMinMana[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffMinMana${a} 0 
   /varset DebuffMinMana[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffMinMobsInArea${a},NOTFOUND]} 
/varset DebuffMinMobsInArea[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffMinMobsInArea${a} 0 
   /varset DebuffMinMobsInArea[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset DebuffAnnounce[${a}] ${Ini[${IniFile},Debuff,DebuffAnnounce${a},NOTFOUND]} 
/if (${DebuffAnnounce[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffAnnounce${a} "Debuff Announcement" 
   /varset DebuffAnnounce[${a}] Debuff Announcement 
   /varset INIFlag 1 
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffMemToSlot${a},NOTFOUND]} 
/varset DebuffMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffMemToSlot${a} 0 
   /varset DebuffMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Debuff,DebuffOnMATarget${a},NOTFOUND]} 
/varset DebuffOnMATarget[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffOnMATarget${a} 0 
   /varset DebuffOnMATarget[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset DebuffCheckTime ${Ini[${IniFile},Debuff,DebuffCheckTime,NOTFOUND]} 
/if (${DebuffCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff DebuffCheckTime 3s 
   /varset DebuffCheckTime 3s 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Debuff,FaceBeforeDebuff,NOTFOUND]} 
/varset FaceBeforeDebuff ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Debuff FaceBeforeDebuff 0
   /varset FaceBeforeDebuff 0
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Events,EventCount,NOTFOUND]} 
/varset EventCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventCount 0 
   /varset EventCount 0 
   /varset INIFlag 1  
} 

/for a 1 to 8 
/varset EventSpell[${a}] ${Ini[${IniFile},Events,EventSpell${a},NOTFOUND]} 
/if (${EventSpell[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventSpell${a} "Event Spell Name" 
   /varset EventSpell[${a}] Event Spell Name 
   /varset INIFlag 1  
} 
/next a 

/if (${EventCount}>0) { 
    /for a 1 to ${EventCount} 
        /varset EventSpellID[${a}] ${Spell["${EventSpell[${a}]}"].ID} 
    /next a 
} 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Events,EventMinMana${a},NOTFOUND]} 
/varset EventMinMana[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventMinMana${a} 100 
   /varset EventMinMana[${a}] 100 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 

/varset TempStr ${Ini[${IniFile},Events,EventMaxMana${a},NOTFOUND]} 
/varset EventMaxMana[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventMaxMana${a} 0 
   /varset EventMaxMana[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Events,EventMinHP${a},NOTFOUND]} 
/varset EventMinHP[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventMinHP${a} 100 
   /varset EventMinHP[${a}] 100 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Events,EventMaxHP${a},NOTFOUND]} 
/varset EventMaxHP[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventMaxHP${a} 0 
   /varset EventMaxHP[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Events,EventDuration${a},NOTFOUND]} 
/varset EventDuration[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventDuration${a} 0 
   /varset EventDuration[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Events,EventMemToSlot${a},NOTFOUND]} 
/varset EventMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventMemToSlot${a} 0 
   /varset EventMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset EventCheckTime ${Ini[${IniFile},Events,EventCheckTime,NOTFOUND]} 
/if (${EventCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Events EventCheckTime 10s 
   /varset EventCheckTime 10s 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Heal,HealCount,NOTFOUND]} 
/varset HealCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealCount 0 
   /varset HealCount 0 
   /varset INIFlag 1  
} 
/for a 1 to 8 
/varset HealSpell[${a}] ${Ini[${IniFile},Heal,HealSpell${a},NOTFOUND]} 
/if (${HealSpell[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealSpell${a} "Heal Spell Name" 
   /varset HealSpell[${a}] Heal Spell Name 
   /varset INIFlag 1  
} 
/next a 

/if (${HealCount}>0) { 
    /for a 1 to ${HealCount} 
        /varset HealSpellID[${a}] ${Spell["${HealSpell[${a}]}"].ID} 
    /next a 
} 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Heal,HealMinHP${a},NOTFOUND]} 
/varset HealMinHP[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealMinHP${a} 0 
   /varset HealMinHP[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Heal,HealMaxHP${a},NOTFOUND]} 
/varset HealMaxHP[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealMaxHP${a} 100 
   /varset HealMaxHP[${a}] 100 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Heal,HealMinMana${a},NOTFOUND]} 
/varset HealMinMana[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealMinMana${a} 0 
   /varset HealMinMana[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Heal,HealMinGroupCount${a},NOTFOUND]} 
/varset HealMinGroupCount[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealMinGroupCount${a} 0 
   /varset HealMinGroupCount[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset HealClass[${a}] ${Ini[${IniFile},Heal,HealClass${a},NOTFOUND]} 
/if (${HealClass[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealClass${a} WAR|SHD|PAL|RNG|MNK|ROG|BRD|BST|BER|SHM|CLR|DRU|WIZ|MAG|ENC|NEC 
   /varset HealClass[${a}] WAR|SHD|PAL|RNG|MNK|ROG|BRD|BST|BER|SHM|CLR|DRU|WIZ|MAG|ENC|NEC 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Heal,HealMemToSlot${a},NOTFOUND]} 
/varset HealMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealMemToSlot${a} 0 
   /varset HealMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset HealCheckTime ${Ini[${IniFile},Heal,HealCheckTime,NOTFOUND]} 
/if (${HealCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealCheckTime 2s 
   /varset HealCheckTime 2s 
   /varset INIFlag 1 
} 

/for a 1 to 8 
/varset HealAnnounce[${a}] ${Ini[${IniFile},Heal,HealAnnounce${a},NOTFOUND]} 
/if (${HealAnnounce[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealAnnounce${a} "Heal Announcement" 
   /varset HealAnnounce[${a}] Heal Announcement 
   /varset INIFlag 1 
} 
/next a 

/varset TempStr ${Ini[${IniFile},Heal,HealPets,NOTFOUND]} 
/varset HealPets ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal HealPets 1 
   /varset HealPets 1 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},Heal,WussyFactor,NOTFOUND]} 
/varset WussyFactor ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Heal WussyFactor 10 
   /varset WussyFactor 10 
   /varset INIFlag 1  
} 

/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffCount,NOTFOUND]} 
/varset GroupBuffCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffCount 0 
   /varset GroupBuffCount 0 
   /varset INIFlag 1  
} 

/for a 1 to 8 
/varset GroupBuff[${a}] ${Ini[${IniFile},GroupBuff,GroupBuff${a},NOTFOUND]} 
/if (${GroupBuff[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuff${a} "Group Buff Spell Name" 
   /varset GroupBuff[${a}] Group Buff Spell Name 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset GroupBuffAliasName[${a}] ${Ini[${IniFile},GroupBuff,GroupBuffAliasName${a},NOTFOUND]} 
/if (${GroupBuffAliasName[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffAliasName${a} "Group Buff Alias Name" 
   /varset GroupBuffAliasName[${a}] Group Buff Alias Name 
   /varset INIFlag 1  
} 
/next a 

/if (${GroupBuffCount}>0) { 
    /for a 1 to ${GroupBuffCount} 
        /varset GroupBuffID[${a}] ${Spell["${GroupBuff[${a}]}"].ID} 
    /next a 
} 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffDuration${a},NOTFOUND]} 
/varset GroupBuffDuration[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffDuration${a} 99999 
   /varset GroupBuffDuration[${a}] 99999 
   /varset INIFlag 1  
} 
/next a 


/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffAtStart${a},NOTFOUND]} 
/varset GroupBuffAtStart[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffAtStart${a} 0 
   /varset GroupBuffAtStart[${a}] 0 
   /varset INIFlag 1 
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffMinMana${a},NOTFOUND]} 
/varset GroupBuffMinMana[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffMinMana${a} 0 
   /varset GroupBuffMinMana[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffMinGroupCount${a},NOTFOUND]} 
/varset GroupBuffMinGroupCount[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffMinGroupCount${a} 0 
   /varset GroupBuffMinGroupCount[${a}] 0 
   /varset INIFlag 1  
} 
/next a 
/for a 1 to 8 
/varset GroupBuffAnnounce[${a}] ${Ini[${IniFile},GroupBuff,GroupBuffAnnounce${a},NOTFOUND]} 
/if (${GroupBuffAnnounce[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffAnnounce${a} "Group Buff Announcement" 
   /varset GroupBuffAnnounce[${a}] Group Buff Announcement 
   /varset INIFlag 1 
} 
/next a 
/for a 1 to 8 
/varset GroupBuffClass[${a}] ${Ini[${IniFile},GroupBuff,GroupBuffClass${a},NOTFOUND]} 
/if (${GroupBuffClass[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffClass${a} WAR|SHD|PAL|RNG|MNK|ROG|BRD|BST|BER|SHM|CLR|DRU|WIZ|MAG|ENC|NEC 
   /varset GroupBuffClass[${a}] WAR|SHD|PAL|RNG|MNK|ROG|BRD|BST|BER|SHM|CLR|DRU|WIZ|MAG|ENC|NEC 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},GroupBuff,GroupBuffMemToSlot${a},NOTFOUND]} 
/varset GroupBuffMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffMemToSlot${a} 0 
   /varset GroupBuffMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset GroupBuffCheckTime ${Ini[${IniFile},GroupBuff,GroupBuffCheckTime,NOTFOUND]} 
/if (${GroupBuffCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" GroupBuff GroupBuffCheckTime 15s 
   /varset GroupBuffCheckTime 15s 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Pet,PausePet,NOTFOUND]} 
/varset PausePet ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PausePet 1 
   /varset PausePet 1 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Pet,PetAssistOnHPPct,NOTFOUND]} 
/varset PetAssistOnHPPct ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetAssistOnHPPct 98 
   /varset PetAssistOnHPPct 98 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Pet,UsePetHold,NOTFOUND]}
/varset UsePetHold ${TempStr}
/if (${TempStr.Equal["NOTFOUND"]}) {
   /ini "${IniFile}" Pet UsePetHold 1 
   /varset UsePetHold 1
   /varset INIFlag 1
}

/varset PetCheckTime ${Ini[${IniFile},Pet,PetAssistCheckTime,NOTFOUND]} 
/if (${PetCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetAssistCheckTime 5s 
   /varset PetCheckTime 5s 
   /varset INIFlag 1 
} 

/varset PetBuffCheckTime ${Ini[${IniFile},Pet,PetBuffCheckTime,NOTFOUND]} 
/if (${PetBuffCheckTime.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetBuffCheckTime 15s 
   /varset PetBuffCheckTime 15s 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Pet,PetBuffCount,NOTFOUND]} 
/varset PetBuffCount ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetBuffCount 0 
   /varset PetBuffCount 0 
   /varset INIFlag 1 
} 

/for a 1 to 8 
/varset PetBuff[${a}] ${Ini[${IniFile},Pet,PetBuff${a},NOTFOUND]} 
/if (${PetBuff[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetBuff${a} "Pet Buff Name" 
   /varset PetBuff[${a}] Pet Buff Name 
   /varset INIFlag 1  
} 
/next a 

/for a 1 to 8 
/varset PetBuffIconName[${a}] ${Ini[${IniFile},Pet,PetBuffIconName${a},NOTFOUND]} 
/if (${PetBuffIconName[${a}].Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetBuffIconName${a} "Pet Buff Icon Name" 
   /varset PetBuffIconName[${a}] Pet Buff Icon Name 
   /varset INIFlag 1 
} 
/next a 

/for a 1 to 8 
/varset TempStr ${Ini[${IniFile},Pet,PetBuffMemToSlot${a},NOTFOUND]} 
/varset PetBuffMemToSlot[${a}] ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetBuffMemToSlot${a} 0 
   /varset PetBuffMemToSlot[${a}] 0 
   /varset INIFlag 1  
} 
/next a 

/varset PetSummonSpell ${Ini[${IniFile},Pet,PetSummonSpell,NOTFOUND]} 
/if (${PetSummonSpell.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetSummonSpell "Pet Summon Spell Name" 
   /varset PetSummonSpell Pet Summon Spell Name 
   /varset INIFlag 1 
} 

/varset TempStr ${Ini[${IniFile},Pet,PetSummonMemToSlot,NOTFOUND]} 
/varset PetSummonMemToSlot ${TempStr} 
/if (${TempStr.Equal["NOTFOUND"]}) { 
   /ini "${IniFile}" Pet PetSummonMemToSlot 0 
   /varset PetSummonMemToSlot 0 
   /varset INIFlag 1 
} 

/if (${INIFlag}==1) { 
   /echo INI file created and populated.  Please customize ${IniFile} in your macros directory. 
   /endmacro 
} 
/tgb on 
/return 

Sub INIListUpdate(a,b,c) 
/declare TempItem string local 
/declare TempVar int local 
/declare TempVar2 int local 
/varset TempVar 0 
/if (${c}==1) /varset TempVar 1 
/if (${a.Length}>0) { 
    :ListSearch 
    /varset TempItem ${Ini[${IniFile},${b},${Int[${TempVar}]},NOTFOUND]} 
    /if (${TempItem.Equal["NOTFOUND"]}) /goto :AddItem 
    /if (${TempItem.Equal["${a}"]}) { 
        /echo -[ ${a} REMOVED from ${b} list. ]- 
        /if (${Reply}==1 && !${SenderName.Equal[nobody]}) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} Ok, I guess I won't ${If[${b.Equal[Watch]},watch,listen to]} ${a} anymore. 
        /ini "${IniFile}" "${b}" "${Int[${TempVar}]}" "Empty" 
        /goto :DoneCategory 
    } 
    /varset TempVar ${Math.Calc[${TempVar}+1]} 
    /goto :ListSearch 
    :AddItem 
    /varset TempVar 0 
    /if (${c}==1) /varset TempVar 1 
    :AddItemLoop 
    /varset TempItem ${Ini[${IniFile},${b},${Int[${TempVar}]},NOTFOUND]} 
    /if (${TempItem.Equal["Empty"]}) /goto :FoundCategorySlot    
    /if (${TempItem.Equal["NOTFOUND"]}) /goto :FoundCategorySlot 
    /varset TempVar ${Math.Calc[${TempVar}+1]} 
    /goto :AddItemLoop 
    :FoundCategorySlot 
    /if ((${TempVar}>10)&&(${b.Equal["Watch"]})) { 
        /echo -(( All slots full, 10 Maximum. ))- 
        /return 
    } 
    /echo -[ ${a} ADDED to ${b} list. ]- 
    /if (${Reply}==1 && !${SenderName.Equal[nobody]}) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} Ok, I will ${If[${b.Equal[Watch]},watch,listen to]} ${a} now. 
    /ini "${IniFile}" "${b}" "${Int[${TempVar}]}" "${a}" 
} 
:DoneCategory 
/return 

Sub Event_Master(EvtText) 
/varset EvtText ${EvtText.Right[-6]} 
/varset SenderName nobody 
/call MasterFunction "${EvtText}" 
/return 

Sub MasterFunction(CmdText) 
/declare TempItem string local 
/declare TempVar int local 
/declare TempVar2 int local 
/declare MakeReply string local 
/varset CmdText ${CmdText.Right[-7]} 
/if (${CmdText.Length}>0) { 
    /call INIListUpdate "${CmdText}" "Masters" "0" 
    /call LoadMasterList 
} else { 
    /varset TempVar2 0 
    /varset TempVar 0 
    /varset MakeReply I'll do whatever these guys say - 
    /echo -[ Allowed Masters ]- 
    :CategoryList 
    /varset TempItem ${Ini[${IniFile},Masters,${Int[${TempVar}]},NOTFOUND]} 
    /if (${TempItem.Equal["NOTFOUND"]}) /goto :DoneCategoryList 
    /varset TempVar ${Math.Calc[${TempVar}+1]} 
    /if (!${TempItem.Equal["Empty"]}) { 
        /varset TempVar2 ${Math.Calc[${TempVar2}+1]} 
        /varset MakeReply ${MakeReply} ${TempItem}, 
        /echo -- Master[${Int[${TempVar2}]}] ${TempItem} 
    } 
    /goto :CategoryList 
    :DoneCategoryList 
    /if (${Reply}==1 && !${SenderName.Equal[nobody]} && ${TempVar2}>0) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} ${MakeReply.Left[-1]}. 
    /if (${Reply}==1 && !${SenderName.Equal[nobody]} && ${TempVar2}==0) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} I'm not listening to anyone. 
    /if (${TempVar2}==0) /echo -(( No Masters Found ))- 
  
} 
/return 

Sub Event_Watch(EvtText) 
/varset EvtText ${EvtText.Right[-6]} 
/varset SenderName nobody 
/call WatchFunction "${EvtText}" 
/return 

Sub WatchFunction(CmdText) 
/declare TempItem string local 
/declare TempVar int local 
/declare TempVar2 int local 
/declare b int local 
/declare MakeReply string local 
/varset CmdText ${CmdText.Right[-6]} 
/if (${CmdText.Length}>0) { 
    /call INIListUpdate "${CmdText}" "Watch" "1" 
    /call LoadWatchList 
} else { 
    /varset TempVar2 0 
    /varset TempVar 1 
    /varset MakeReply I'll be watching the health of these guys - 
    /echo -[ Watch List ]- 
    :CategoryList 
    /varset TempItem ${Ini[${IniFile},Watch,${Int[${TempVar}]},NOTFOUND]} 
    /if (${TempItem.Equal["NOTFOUND"]}) /goto :DoneCategoryList 
    /varset TempVar ${Math.Calc[${TempVar}+1]} 
    /if (!${TempItem.Equal["Empty"]}) { 
        /varset TempVar2 ${Math.Calc[${TempVar2}+1]} 
        /varset MakeReply ${MakeReply} ${TempItem}, 
        /echo -- Watch Target[${Int[${TempVar2}]}] ${TempItem} 
    } 
    /goto :CategoryList 
    :DoneCategoryList 
    /if (${Reply}==1 && !${SenderName.Equal[nobody]} && ${TempVar2}>0) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} ${MakeReply.Left[-1]}. 
    /if (${Reply}==1 && !${SenderName.Equal[nobody]} && ${TempVar2}==0) /docommand /${If[${ReplyChannel.Find[ @]}>0,${ReplyChannel.Mid[1,${Math.Calc[${ReplyChannel.Find[ @]}-1]}]} ${SenderName},${ReplyChannel}]} I'm not watching anyones health. 
    /if (${TempVar2}==0) /echo -(( No Watch List Found ))- 
  
} 
/return 
